define(function (require, exports, module) {
  var mCard = require('andrew/card/index.js')
  var Element = require('third/element/index.js')

  var app = new Vue({
    mixins: [Element.mixin],
    data: function () {
      return {
        tableList: []
      }
    },
    mounted: function () {
      this.getDataList()
    },
    methods: {
      getDataList: function () {
        this.tableList = [{
          id: 1,
          pId: 0,
          name: '业务体系',
          level: 1,
          dataFlag: 1,
          children: [{
            id: 1,
            pId: 0,
            name: '业务体系',
            level: 1,
            dataFlag: 1,
            children: []
          }, {
            id: 1,
            pId: 0,
            name: '业务体系',
            level: 1,
            dataFlag: 1,
            children: []
          }]
        }]
      },
      handleEdit(index, row) {
        console.log(index, row)
        pageVue = this

        var id = row.id || 0

        // iframe窗
        var index = layer.open({
          type: 2,
          title: '文章基本信息修改',
          shade: [0],
          area: ['80%', '90%'],
          content: ['artEdit.html?id=' + id], // iframe的url，no代表不显示滚动条
          end: function () { // 此处用于演示
            alert(0)

            pageVue.getDataList()
          }
        })
      },
      handleArtEdit(index, row) {
        console.log(index, row)
      },

      handleDelete(index, row) {
        console.log(index, row)
      }
    }

  }).$mount('#app')
})
